package de.bazinga.rotw.effects;

import com.captiveimagination.jgn.message.Message;
import com.captiveimagination.jgn.message.type.CertifiedMessage;
import com.captiveimagination.jgn.message.type.PlayerMessage;
import com.captiveimagination.jgn.message.type.TimestampedMessage;
import com.jme.math.Triangle;
import com.jme.math.Vector3f;

import de.bazinga.rotw.game.RotwGameState;
import de.bazinga.rotw.network.message.GameMessage;

public class BulletHoleMessage extends Message implements CertifiedMessage, PlayerMessage, TimestampedMessage, GameMessage {
	private Vector3f location = null;
	private Triangle hitTriangle = null;
	
	public void handleMessage(RotwGameState game, Message msg, boolean server) {
		if(!(msg instanceof BulletHoleMessage)) return ;
		
		if(!server) {
			BulletHoles.getInstance().setBulletHole(location,hitTriangle);
		}
	}

	public void setLocation(Vector3f location) {
		this.location = location;
	}

	public Vector3f getLocation() {
		return location;
	}

	public void setHitTriangle(Triangle hitTriangle) {
		this.hitTriangle = hitTriangle;
	}

	public Triangle getHitTriangle() {
		return hitTriangle;
	}
}